package com.zsk.shop.enums;

/**
 * @author ljh
 * @create 2021/7/20 16:47
 */
public enum EnumDecodeClientType {
    CLIENT("client", 0),
    H5("h5", 1),
    MINI("mini", 2),
    JS("JS",3);

    String name;
    Integer code;

    public static String getNameByCode(Integer code) {
        EnumDecodeClientType[] enums = EnumDecodeClientType.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getName();
            }
        }
        return "";
    }

    EnumDecodeClientType(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
